package com.emm.yixun.marketing.service;
import java.math.BigDecimal;

import javax.jws.WebService;

import com.emm.yixun.common.page.Page;
import com.emm.yixun.common.response.Response;
import com.emm.yixun.common.response.ResponseList;
import com.emm.yixun.common.model.HaveReceiveRefund;
import com.emm.yixun.common.model.HaveReceiveRefundInfo;
import com.emm.yixun.common.model.dto.HaveReceiveRefundDto;
import com.emm.yixun.common.model.dto.HaveReceiveRefundInfoDto;
@WebService
public interface HaveReceiveRefundServiceFacade{
     	/**
	    *新增
	    */
		Response<HaveReceiveRefundDto> save(HaveReceiveRefundDto dto);
		
		/**
		*修改,当selective=true时修改非空列,当selective=false修改所有列
		*/
		Response<Integer> updateByPrimaryKey(HaveReceiveRefundDto dto,Boolean selective);
		
		/**
		 *逻辑删除
		 */
		Response<Integer> deleteByPrimaryKey(Long id);
		
		/**
		 *主键查询
		 */
		Response<HaveReceiveRefund> findById(Long id);
		
		/**
		 *主键查询
		 */
		Response<HaveReceiveRefundInfo> findInfoById(Long id);
		
		/**
		 *根据dto查询记录
		 */
		ResponseList<HaveReceiveRefund> findByDto(HaveReceiveRefundDto dto);
		/**
		 *根据dto以及分页参数查询记录
		 */
		Page<HaveReceiveRefund> findPageByDto(HaveReceiveRefundDto dto,Integer begin,Integer row);
		
		/**
		 *根据dto以及分页参数查询记录
		 */
		Page<HaveReceiveRefundInfo> findPageByDtoInfo(HaveReceiveRefundInfoDto dto,Integer begin,Integer row);
		
		/**
		 * 已收款金额
		 * @param dto
		 * @return
		 */
		Double haveReceiveAmount(HaveReceiveRefundDto dto);
		
		/**
		* 方法描述 : 根据应收ID 查询已收金额
		* 创建者：ThinkPad 
		* 项目名称： emm-marketing-api
		* 类名： HaveReceiveRefundServiceFacade.java
		* 版本： v1.0
		* 创建时间： 2016年8月2日 下午5:16:11
		* @param needId
		* @return Response<BigDecimal>
		 */
		public Response<BigDecimal> findHaveAmount(Long needId);
		
		
		public Response<Integer> deleteByDto(HaveReceiveRefundDto dto);
		
		boolean addRefund(HaveReceiveRefundDto entity, long id, BigDecimal counterFee, BigDecimal realAmount,
				String needOrHave);
		
		Response<BigDecimal> findHaveAmountByDto(HaveReceiveRefundDto dto);
		/**
		 * 
		 * findSubscribeHaveAmount:(认购已收金额). <br/>
		 *
		 * @author Administrator
		 * @param subId
		 * @return
		 * @since JDK 1.6
		 */
		public Response<BigDecimal> findSubscribeHaveAmount(Long subId);
}
